8] Depth of field, By George de Beaumont.
I've spent a fair amount of time investigating Imagine's Depth of Field feature and thought I'd share my findings. The following text is long winded, excessively formal and has not been reviewed for errors. Still, You may find something of use. If not, don't hesitate to delete...
Depth of Field.
Depth of Field - Overview:
According to the addendum text file accompanying Imagine 3.0,
the Depth of Field (DOF) feature was added late in development and
is therefore not covered in the manual. While the supplemental DOF
text file is brimming with potentially useful information, it has
not been prepared with the average end user in mind. Compounding
this problem is a less than intuitive DOF interface (DOF and 3D stereo
imaging share the same parameters and requester box). The result
is an exceptionally high learning curve. The goal of this text is
to strip away the noise associated with the mixed function interface
and provide a practical explanation of the Depth of Field feature.
Depth of Field - Useful Photographic Concepts:
Imagine 3.0 simulates many of the real world relationships
associated with photography/v ideo graphy. These include:
- Focal point:
- It is the point of perfect focus.
Objects nearer or farther tend to be blurred, although an acceptable field of focus
extends for some distance on the near and far sides of this plane.
- Depth of field (DOF):
- The Depth of Field is the range of distances from the camera over which focus is c
onsidered adequately sharp.
- Field of view (FOV):
- FOV is the width of the camera viewing area (usually expressed in degrees).
FOV depends on the lens focal length.
- Focal length:
- This is the distance behind the lens (usually expressed
in millimeters) where the image will be in sharp focus.
The focal length also provides an indication of the FOV
the user can expect from a camera system. The terms FOV
and focal length are used interchangeably in this text.
Common focal lengths and their associated FOV are given below.
focal length (mm) | fov (degrees) | lens type |
17 | 180 | fisheye |
28 | 94 | wide angle |
20 | 75 | wide angle |
50 | 46 | standard |
55 | 43 | standard |
100 | 24 | intermediate telephoto |
135 | 18 | intermediate telephoto |
200 | 12 | long telephoto |
500 | 5 | long telephoto |
- Aperture:
- The aperture of a lens is the opening through which light is admitted.
In photography/videography is desirable to be able to adjust the amount of
light passing through the lens. This is accomplished via a variable diaphragm.
A wide aperture lets in more light but at the expense of a greatly reduced DOF.
The effect of focal length, aperture size and focal point on DOF:
It is the interaction of the focal length, aperture size and focal point which
determine the DOF for a specific situation. In general:
- Shorter focal lengths provide increased DOF;
- Narrower apertures provide increased DOF;
- Focal points farther from the camera provide increased
DOF.
Depth of Field - Imagine's Photographic Counterparts:
Imagine's DOF, FOV (or focal length) and aperture controls are
intimately associated with the camera's X and Y sizes.
FOV:
We have all adjusted the camera view interactively via the angle (A),
zoom (Z) and perspective (P) controls associated with the perspective
view in the Stage editor. What follows is a description of how Imagine
numerically handles some of this information.
The camera's FOV depends on the RATIO of the camera X and Y sizes.
These values can be examined via the Transformation requester (Stage editor)
or Camera size timeline (Action editor). The important thing to remember,
is that a particular X or Y size does not determine FOV, but the ratio of X/Y
(X divided by Y) does. There are MANY X and Y values that will yield the SAME
X/Y ratio (and therefore the same FOV). See the following examples:
X | Y | X/Y | FOV (degrees) |
100 | 320 | .31 | 18 |
200 | 640 | .31 | 18 |
100 | 200 | .5 | 55 |
320 | 640 | .5 | 55 |
Changing the FOV numerically:
As the X/Y ratio changes, so does the FOV. If You decrease X or increase Y
(make the ratio smaller) You will zoom in (narrow the FOV). If You increase
X or decrease Y (make ratio larger) You will zoom out (widen the FOV).
When modeling real life situations, the following may be used as a
guide for setting Imagine's FOV numerically.
focal length (mm) | fov (degrees) | X/Y ratio | example X/Y |
20 | 94 |
2.19 | 1400/640 |
28 | 75 |
0.68 | 435/640 |
55 | 43 |
0.50 | 320/640 |
100 | 24 |
0.43 | 277/640 |
135 | 18 |
0.31 | 200/640 |
200 | 12 |
0.22 | 143/640 |
500 | 5 |
0.04 | 28/640 |
An examination of the FOV and X/Y ratio values show that they
do not change proportionally (i.e. doubling the ratio does not
double the FOV). The relationship is logarithmic. That is, making
a wide FOV wider requires a much greater change in the X/Y ratio.
Be aware that wide FOVs produce considerable distortion,
especially at the edges (certain port ions of the image will
appear disproportionately large).
Focal point:
Imagine's focal point is associated with the camera
Y axis (the camera view points in the direction of the Y axis).
Until the DOF feature is activated (in the Action editor), all
objects will be in perfect focus (infinite DOF) and a specific
camera Y size is not important. When the DOF function is activated
the camera Y size will have a dual role (we already know that the
camera size X/Y ratio affects FOV). When DOF is activated, the camera
Y size will also specify the distance from the camera which is the point
of perfect focus (FOCAL POINT).
Depth of field:
In a real camera, it is the interaction of the lens focal length,
aperture size and the point of focus that determines the DOF.
In Imagine, the DOF can be configured in several ways. It can be
set to a specific numerical value independent of the aperture size
or FOV (or focal length). If desired, the DOF can be tied to an
apparent aperture size and FOV to allow the simulation of camera optics.
Aperture:
Imagine 3.0 has only a limited notion of aperture size.
Imagine uses an apparent aperture size to influence the DOF.
This aperture size does not in any way affect the amount of
light reaching Imagine's virtual camera. Lighting changes
must be done by altering the intensity of ambient lighting
or the individual light sources.
Depth of Field - Overview of the DOF/3DS requester:
To activate the depth of field function, You must go to the Action editor and add an Actor
bar to the camera timeline. This will open up a the 3D Stereo/Depth of Field Requester box.
The following check/data entry boxes deal with the 3D Stereo image features and can be
IGNORED when adding simple depth of field to Your project:
- Y Size is (3DS) Screen Distance (check box)
- Distance Multiplier (data entry box)
- Eye Separation (3DS) (data entry box)
- Eye Sep is Screen Width Multiplier (check box)
- Eye Sep is Actual Size at Scrn Dist (check box)
The check/data entry boxes that pertain directly to DOF are:
- Y size is DOF focus distance (check box)
- Aperture size (DOF) (data entry box)
- Ap. size is DOF width multiplier (check box)
- Ap. size is actual size (check box)
Depth of Field - Activating DOF feature:
Check the "Y size is DOF focus distance" box to activate the DOF feature.
Depth of Field - Choosing static or dynamic DOF:
Next, check one of the two following boxes:
- Ap. size is DOF width multiplier (static DOF)
- Ap. size is actual size (dynamic DOF)
Which one You check will depend on whether or not You need to animate the DOF effect.
For example, You may want to animate the DOF effect to simulate the optics of a
real video camera. If You were to focus a video camera on an object (at some
intermediate distance) and then zoom in (close-up), You would observe that
the background would progressively become out of focus.
Depth of Field - Configuring the Aperture Size (DOF) data entry box:
Imagine will interpret the value that You enter into the "Aperture Size (DOF)" box differently,
depending on whether You chose the static or dynamic version of the DOF feature.
Static DOF ("Ap. size is DOF width multiplier" box checked):
This DOF option is static in the sense that changes in the FOV (X/Y ratio) do not alter the DOF.
The value You enter in the "Aperture Size (DOF) box" will be multiplied by the pixel width of
the image (set in the Project editor). The product of which will be the maximum defocusing that
will occur for objects in the distant background (in pixels). Larger values result in a narrower
DOF and greater defocusing of distant objects. In lieu of using the following equation, entering a
small number (0.01) will usually provide an acceptable starting value.
The equation for determining the Aperture Size (DOF) box value:
A = D/W
where:
A = |
Aperture Size (DOF) value |
D = |
Desired maximum defocusing (in pixels) |
W = |
Image width (in pixels) |
Example: if You wanted the maximum defocusing to be 6.4 pixels
(at distant background) divide 6.4 by the image width (set in
the Project editor):
- A = 6.4/640
- A = 0.01
Dynamic DOF (Ap. size is actual size box checked):
When You choose this option, DOF becomes linked to the camera X size
value (see the equation below). This DOF option is dynamic in the sense
that as You change the FOV (X/Y ratio), the DOF also changes. The dynamic
DOF option can be animated to simulate camera optics. Like the static DOF
option, larger values result in a decreased DOF and increased defocusing of
the distant background. In lieu of using the following equation, entering
values in the range of 2 - 4 generally provide an acceptable starting point.
The equation for determining the Aperture Size (DOF) box value:
A = DX/W
where:
A = |
Aperture Size (DOF) value |
D = |
Desired maximum defocusing (in pixels) |
W = |
Image width (in pixels) |
X = |
Camera X size |
Example: You want a maximum defocusing of distant objects to be
6.4 pixels. You have set the camera FOV. The camera X/Y ratio
is 320/640. The image width (Project editor) is 640 pixels.
- A = (6.4 x 320)/640
- A = 3.2
Depth of Field - Setting Point of Focus:
As previously mentioned, once the DOF function is activated, the camera
Y size determines the focal point. The trick is to vary the Y size
(change point of focus) while keeping the desired focal length (FOV).
This is accomplished by first activating the camera line function
(Stage editor/Display menu). Next scale the camera, using the Y bounding line
(Top view) as the guide for determining the point of focus. As long as the
X and Y axis are scaled proportionally, the focal length (FOV) will remain the same.
Depth of Field - Summary:
This text provides the basics for implementing the Imagine 3.0
Depth of Field feature. Use of 3D stereo imagining (LCD shutter glasses)
with Depth of Field has not be covered. These instructions should provide a
sufficient basis for understandi ng the Impulse supplemental text.
While Impulse's implementation of Depth of Field is not particularly
intuitive, it does offer lots of flexibili ty and artistic potential.
For instance, You could progressively defocus one obj ect while bringing
another into sharp focus (thereby changing the viewer's point of attention)
by t ransitioning between two equivalent X/Y camera size ratios.
There are undoubtedl y many other ways to use this feature creatively.
Be aware that the amount of defocusing adversely affects rendering time.
Severe defocusing (narrow DOF) not only results in longer rendering
times but also does not always yield photorealistic results.
Depth of Field - Corrections to DOF text:
In the text I listed focal lengths and their equivalent field of view.
The values are specific to a 35mm SLR type camera system (which I
did not mention). This may mislead some who may want to simulate
other camera systems (video or still). Even though focal length
and field of view are related concepts, I was not technically
correct to use the terms interchangeably.
Pages made from the amigaguide version with the help of Mike's
RDAG2HTML
and the fabulous Dietmar's GoldED with the
WWW extension v2.